from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import random

op = webdriver.ChromeOptions()
op.add_experimental_option('excludeSwitches', ['enable-automation'])
op.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=op)

driver.get("https://jqueryui.com/slider/#hotelrooms")
windows_content = driver.find_element(By.CSS_SELECTOR, '#content>iframe')
driver.switch_to.frame(windows_content)
select = driver.find_element(By.CSS_SELECTOR, "#minbeds")
ActionChains(driver).click(select).perform()
ran = random.randint(1,6)
for i in range(ran):
    select.send_keys(Keys.DOWN)
    sleep(0.5)
sleep(2)
selectAct = ActionChains(driver)
selectAct.click(select).perform()
sleep(2)

progress = driver.find_element(By.CSS_SELECTOR, "#slider > span")
ActionChains(driver).click(progress).perform()
ran = random.randint(1,6)
for i in range(ran):
    progress.send_keys(Keys.DOWN)
    sleep(0.5)
sleep(2)
progressAct = ActionChains(driver)
progressAct.click(progress).perform()
sleep(2)

driver.quit()
